<?='<?xml version="1.0" encoding="utf-8"?>'?>
<!DOCTYPE yml_catalog SYSTEM "shops.dtd">
<yml_catalog date="<?=date('Y-m-d H:i')?>">
<shop>
	<name><?=$this->name?></name>
  	<company><?=$this->company?></company>
	<url><?=$this->serverUrl();?></url>
	<currencies>
		<currency id="RUR" rate="1"/>
	</currencies>
	<categories>
<?php   foreach ($this->categories as $c):?>
        <category id="<?=$c->getId()?>" <?=($c->getParentId()!=null? ' parentId="'.$c->getParentId().'"':'')?>><?=$c->getName()?></category>
<?php   endforeach;?>
	</categories>
	<offers>
<?php   $id=1;
        foreach ($this->offers as $offer):
            $o = $offer[0];
            $node=$offer[1];?>
        <offer id="<?=$id?>" type="vendor.model" available="<?=$o->getAvailable()?'true':'false'?>" bid="<?=$o->getBid()?>"<?=$o->getCid()>0?' cbid="'.$o->getCid().'"':''?>>
            <url><?=$this->serverUrl();?><?php	$url = $node->getURL(); if ($url{0}!='/') echo '/'; echo $url;?></url>
            <price><?=$node->getPrice()?></price>
            <currencyId><?=$o->getCurrencyId()?></currencyId>
            <categoryId><?=$o->getCategoryId()?></categoryId>
            <picture><?=$this->serverUrl();?><?=$node->getPicture()?></picture>
            <delivery><?=$o->getDelivery()?></delivery>
            <typePrefix><?=$o->getTypePrefix()?></typePrefix>
            <vendor><?=$o->getVendor()?></vendor>
            <vendorCode><?=$o->getVendorCode()?></vendorCode>
            <model><?=$o->getModel()?></model>
            <description><?=$o->getDescription()?></description>
            <manufacturer_warranty><?=$o->getManufacturerWarranty()?></manufacturer_warranty>
			<?php if (""!=$o->getCountryOfOrigin()):?><country_of_origin><?=$o->getCountryOfOrigin()?></country_of_origin><?php endif;?>
        </offer>
<?php       $id++;
        endforeach;?>
	</offers>
</shop>
</yml_catalog>